<template>
  <div class="platform-look-img">
    <el-dialog title="查看图纸"
               :visible.sync="dialogVisible"
               width="50%"
               class="look-img-dialog-style"
               :modal-append-to-body="false"
               :append-to-body="true"
               :before-close="handleClose">
      <el-row class="row-main">
        <div>
          <img :src="imgUrl"
               class="img-style"
               alt="">
        </div>
      </el-row>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    imgUrl: {
      type: String,
      default: () => {
        return ''
      }
    },
    lookImgDialog: {
      type: Boolean,
      default: () => {
        return false
      }
    },
  },
  data () {
    return {
      url: '',//图片的链接
      dialogVisible: false,
    }
  },
  methods: {
    handleClose (done) {
      this.$emit('update:lookImgDialog', false)
      this.$emit('update:imgUrl', '')
      done();
    }
  },
  watch: {
    lookImgDialog (n, o) {
      this.dialogVisible = n;
    }
  },
  created () {
    this.dialogVisible = this.lookImgDialog;
  }
}
</script>

<style lang="scss" scoped>
.row-main {
  width: 100%;
  height: 550px;
  background-color: none;
  img {
    width: 100%;
    height: 550px;
  }
}
</style>